package com.woniu.order.controller;


import com.woniu.model.Result;
import com.woniu.order.model.CurriculumOrderEvaluation;
import com.woniu.order.service.CurriculumOrderEvaluationService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 杜岷芫
 * @since 2024年07月12日
 */

@RestController
@RequestMapping("/curriculumOrderEvaluation")
@Api(tags = "评价接口")
public class CurriculumOrderEvaluationController {
    public class CommunicateController {

        @Resource
        private CurriculumOrderEvaluationService service;


        // 返回树形结构评论数据

        @RequestMapping("/CurriculumOrderEvaluationlist")
        @ApiOperation(value = "树形评论数据")
        public Result list() {
            List<CurriculumOrderEvaluation> ac = service.listTree();
            return Result.getResult().setCode(200).setMsg("查询成功").setData(ac);
        }


       //保存评论

        @RequestMapping("/CurriculumOrderEvaluationsave")
        @ApiOperation(value = "保存评论")
        public CurriculumOrderEvaluationService save(@RequestBody CurriculumOrderEvaluationService entity) {
            service.save((CurriculumOrderEvaluation) entity);
            return (CurriculumOrderEvaluationService) Result.getResult().setCode(200).setMsg("保存评论成功");
        }
    }
}

